#include "Singleton.h"
#include "Texture.h"
#include <string>
#include <sstream>
#include <windows.h>
#include <iostream>
#include <malloc.h>

using namespace std;

Singleton* Singleton::single = NULL;

Singleton* Singleton::getInstance()
{
    if(single == NULL)
        single = new Singleton();
	return single;
}

Singleton::Singleton()
{
	mario = new CTexture("Images/MarioLarger.png", 6, 1, 6);
	fungi = new CTexture("Images/Fungi.png", 3, 1, 3);
	flower = new CTexture("Images/Flower.png", 4, 1, 4);
	coin = new CTexture("Images/Coin.png", 7, 1, 7);
	question = new CTexture("Images/Question.png", 7, 1, 7);
	turtle = new CTexture("Images/Turtle.png", 7, 1, 7);
	landLeft = new CTexture("Images/13.png");
	landRight = new CTexture("Images/15.png");
	landCenter = new CTexture("Images/14.png");
	pipe = new CTexture("Images/30.png");
	brick = new CTexture("Images/16.png");
	cloud = new CTexture("Images/19.png");
	grass = new CTexture("Images/25.png");
	castle = new CTexture("Images/18.png");
	mountain = new CTexture("Images/28.png");
	mushroom = new CTexture("Images/27.png");
}

CTexture* Singleton::getTexture(EnumID id)
{
	switch(id)
	{
	case EnumID::Mario_Big_ID:
		return mario;
		break;
	case EnumID::LandCenter_ID:
		return landCenter;
		break;
	case EnumID::LandLeft_ID:
		return landLeft;
		break;
	case EnumID::LandRight_ID:
		return landRight;
		break;
	case EnumID::Brick_ID:
		return brick;
		break;
	case EnumID::Castle_ID:
		return castle;
		break;
	case EnumID::Cloud_ID:
		return cloud;
		break;
	case EnumID::Coin_ID:
		return coin;
		break;
	case EnumID::Flower_ID:
		return flower;
		break;
	case EnumID::Fungi_ID:
		return fungi;
		break;
	case EnumID::Grass_ID:
		return grass;
		break;
	case EnumID::Mushroom_ID:
		return mushroom;
		break;
	case EnumID::Mountain_ID:
		return mountain;
		break;
	case EnumID::Pipe_ID:
		return pipe;
		break;
	case EnumID::Question_ID:
		return question;
		break;
	case EnumID::Turtle_ID:
		return turtle;
		break;
	}
}